package com.team.employment.web.admin.controller.communal;

import com.team.employment.common.result.Result;
import com.team.employment.model.enums.DegreeType;
import com.team.employment.web.admin.vo.DegreeTypeVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Tag(name = "学历信息管理")
@RestController
@RequestMapping("/admin/degreeInfo")
public class DegreeInfoController {

    @Operation(summary = "直接返回所有学历信息的枚举值")
    @GetMapping("getDegreeName")
    public Result<List<DegreeTypeVo>> getDegreeName(){
        List<DegreeTypeVo> list = new ArrayList<>();
        for (DegreeType degreeType:DegreeType.values()) {
            DegreeTypeVo vo = DegreeTypeVo.builder().degreeId(degreeType.getCode()).degreeName(degreeType.getName()).build();
            list.add(vo);
        }
        return Result.ok(list);
    }

}
